package common;

import java.util.ArrayList;
import java.util.List;

import org.dozer.DozerBeanMapper;

public class Mapper extends DozerBeanMapper{
	
	/**
	 * Map a list of object to a list of object of the destination class
	 * @param sourceList - {@link List} of objects to map
	 * @param clazz - Destination class
	 * @return a {@link List} of object of the destination class.
	 */
	public <T> List<T> mapList(List<?> sourceList, Class<T> clazz) {
		List<T> result = new ArrayList<T>();
		for (Object item : sourceList) {
			result.add(this.map(item, clazz));
		}
		return result;
	}
}
